/**
 * 地图查询组件
 * @author liuyan
 */
define(["dojo/_base/declare",
		"esri/map",
		"esri/layers/FeatureLayer",
		"esri/InfoTemplate",
		"esri/layers/ArcGISDynamicMapServiceLayer",
		"esri/layers/ArcGISTiledMapServiceLayer",
		"esri/symbols/SimpleFillSymbol",
		"esri/symbols/SimpleLineSymbol",
		"esri/config",
		"esri/tasks/IdentifyTask",
		"esri/tasks/IdentifyParameters",
		"esri/dijit/Popup",
		"dojo/_base/array",
		"esri/Color",
		"dojo/dom-construct",
		"esri/SpatialReference",
		"dojo/domReady!"
	],
	function(declare, Map, FeatureLayer, InfoTemplate, ArcGISDynamicMapServiceLayer, ArcGISTiledMapServiceLayer,
		SimpleFillSymbol, SimpleLineSymbol, esriConfig, IdentifyTask, IdentifyParameters, Popup,
		arrayUtils, Color, domConstruct, SpatialReference) {
		return declare(null, {
			identifyTask: null,
			identifyParams: null,
			layers:"",
			layerIds:[],
			constructor: function(params) {
				/*if(params&&params.options){
					params.options=lang.mixin(this.options,params.options);
				}*/
			    declare.safeMixin(this, params);
				this.init();
			},
			init:function(){
				this.identifyParams=new IdentifyParameters();
				this.identifyParams.geometry = this.mapPoint;
				this.identifyParams.mapExtent = this.map.extent;
				this.identifyTask=new IdentifyTask(this.layers);
				this.identifyParams.tolerance = 3;
				this.identifyParams.returnGeometry = true;
				this.identifyParams.layerIds = this.layerIds;
				this.identifyParams.layerOption = IdentifyParameters.LAYER_OPTION_ALL;
				this.identifyParams.width = this.map.width;
				this.identifyParams.height = this.map.height;
				
			},
			excute:function(){
				return this.identifyTask.execute(this.identifyParams);
			}
			
		});
	});
